home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / LATEX macros.adf / inputs / unsrt.bst < prev   
Text File  |  1988-02-21  |  13KB  |  699 lines

  1. % BibTeX standard bibliography style `unsrt'
  2.     % version 0.98c for BibTeX versions 0.98i or later, LaTeX version 2.08
  3.     % Copyright (C) 1985, all rights reserved
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst
  8.     % This restriction helps ensure that all standard styles are identical
  9.  
  10. ENTRY
  11.   { address
  12.     author
  13.     booktitle
  14.     chapter
  15.     edition
  16.     editor
  17.     howpublished
  18.     institution
  19.     journal
  20.     key
  21.     month
  22.     note
  23.     number
  24.     organization
  25.     pages
  26.     publisher
  27.     school
  28.     series
  29.     title
  30.     type
  31.     volume
  32.     year
  33.   }
  34.   {}
  35.   {label}
  36.  
  37. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  38.  
  39. FUNCTION {init.state.consts}
  40. { 'before.all #0 :=
  41.   'mid.sentence #1 :=
  42.   'after.sentence #2 :=
  43.   'after.block #3 :=
  44. }
  45.  
  46. STRINGS { s t }
  47.  
  48. FUNCTION {output.nonnull}
  49. { 's swap$ :=
  50.   output.state mid.sentence =
  51.     { ", " * write$ }
  52.     { output.state after.block =
  53.     { add.period$ write$
  54.       newline$
  55.       "\newblock " write$
  56.     }
  57.     { output.state before.all =
  58.         'write$
  59.         { add.period$ " " * write$ }
  60.       if$
  61.     }
  62.       if$
  63.     }
  64.   if$
  65.   'output.state mid.sentence :=
  66.   s
  67. }
  68.  
  69. FUNCTION {output}
  70. { 's swap$ :=
  71.   s "" =
  72.     'skip$
  73.     { s output.nonnull }
  74.   if$
  75. }
  76.  
  77. FUNCTION {output.check}
  78. { 's swap$ :=
  79.   't swap$ :=
  80.   s "" =
  81.     { "Warning: the " t * " shouldn't be empty in " * cite$ * top$ }
  82.     { s output.nonnull }
  83.   if$
  84. }
  85.  
  86. FUNCTION {output.bibitem}
  87. { newline$
  88.   "\bibitem{" write$
  89.   cite$ write$
  90.   "}" write$
  91.   newline$
  92.   ""
  93.   'output.state before.all :=
  94. }
  95.  
  96. FUNCTION {fin.entry}
  97. { add.period$
  98.   write$
  99.   newline$
  100. }
  101.  
  102. FUNCTION {new.block}
  103. { output.state before.all =
  104.     'skip$
  105.     { 'output.state after.block := }
  106.   if$
  107. }
  108.  
  109. FUNCTION {new.sentence}
  110. { output.state after.block =
  111.     'skip$
  112.     { output.state before.all =
  113.     'skip$
  114.     { 'output.state after.sentence := }
  115.       if$
  116.     }
  117.   if$
  118. }
  119.  
  120. FUNCTION {not}
  121. {   { #0 }
  122.     { #1 }
  123.   if$
  124. }
  125.  
  126. FUNCTION {and}
  127. {   'skip$
  128.     { pop$ #0 }
  129.   if$
  130. }
  131.  
  132. FUNCTION {or}
  133. {   { pop$ #1 }
  134.     'skip$
  135.   if$
  136. }
  137.  
  138. FUNCTION {field.or.null}
  139. { duplicate$
  140.   missing$
  141.     { pop$ "" }
  142.     'skip$
  143.   if$
  144. }
  145.  
  146. FUNCTION {italicize}
  147. { 's swap$ :=
  148.   s "" =
  149.     { "" }
  150.     { "{\it " s * "}" * }
  151.   if$
  152. }
  153.  
  154. INTEGERS { nameptr namesleft numnames }
  155.  
  156. STRINGS {nameresult}
  157.  
  158. FUNCTION {format.names}
  159. { 's swap$ :=
  160.   'nameptr #1 :=
  161.   'nameresult "" :=
  162.   'numnames s num.names$ :=
  163.   'namesleft numnames :=
  164.     { namesleft #0 > }
  165.     {
  166.       't s nameptr "{ff }{vv~}{ll}{, jj}" format.name$ :=
  167.       nameptr #1 >
  168.     { namesleft #1 >
  169.         { 'nameresult nameresult ", " * t * := }
  170.         { numnames #2 >
  171.         { 'nameresult nameresult "," * := }
  172.         'skip$
  173.           if$
  174.           t "others" =
  175.         { 'nameresult nameresult " et al." * := }
  176.         { 'nameresult nameresult " and " * t * := }
  177.           if$
  178.         }
  179.       if$
  180.     }
  181.     { 'nameresult nameresult t * := }
  182.       if$
  183.       'nameptr nameptr #1 + :=
  184.       'namesleft namesleft #1 - :=
  185.     }
  186.   while$
  187.   nameresult
  188. }
  189.  
  190. FUNCTION {format.authors}
  191. { author missing$
  192.     { "" }
  193.     { author format.names }
  194.   if$
  195. }
  196.  
  197. FUNCTION {format.editors}
  198. { editor missing$
  199.     { "" }
  200.     { editor num.names$ #1 >
  201.     { editor format.names ", editors" * }
  202.     { editor format.names ", editor" * }
  203.       if$
  204.     }
  205.   if$
  206. }
  207.  
  208. FUNCTION {format.title}
  209. { title missing$
  210.     { "" }
  211.     { title "ul" change.case$ }
  212.   if$
  213. }
  214.  
  215. FUNCTION {entry.string.max} { #100 }
  216.  
  217. FUNCTION {global.string.max} { #300 }
  218.  
  219. STRINGS {pageresult}
  220.  
  221. FUNCTION {n.dashify}
  222. { 't swap$ :=
  223.   'pageresult "" :=
  224.     { t "" = not }
  225.     { t #1 #1 substring$ "-" =
  226.     { t #1 #2 substring$ "--" = not
  227.         { 'pageresult pageresult "--" * :=
  228.           't t #2 global.string.max substring$ :=
  229.         }
  230.         {   { t #1 #1 substring$ "-" = }
  231.         { 'pageresult pageresult "-" * :=
  232.           't t #2 global.string.max substring$ :=
  233.         }
  234.           while$
  235.         }
  236.       if$
  237.     }
  238.     { 'pageresult pageresult t #1 #1 substring$ * :=
  239.       't t #2 global.string.max substring$ :=
  240.     }
  241.       if$
  242.     }
  243.   while$
  244.   pageresult
  245. }
  246.  
  247. FUNCTION {format.date}
  248. { year missing$
  249.     { month missing$
  250.     { "" }
  251.     { "Warning: there's a month but no year in " cite$ * top$
  252.       month
  253.     }
  254.       if$
  255.     }
  256.     { month missing$
  257.     { year }
  258.     { month " " * year * }
  259.       if$
  260.     }
  261.   if$
  262. }
  263.  
  264. FUNCTION {format.btitle}
  265. { title field.or.null
  266.   italicize
  267. }
  268.  
  269. FUNCTION {format.bvolume}
  270. { volume missing$
  271.     { series missing$
  272.     { "" }
  273.     { series italicize }
  274.       if$
  275.     }
  276.     { "Volume~" volume *
  277.       series missing$
  278.     'skip$
  279.     { " of " * series italicize * }
  280.       if$
  281.     }
  282.   if$
  283. }
  284.  
  285. FUNCTION {format.edition}
  286. { edition missing$
  287.     { "" }
  288.     { edition "ll" change.case$ " edition" * }
  289.   if$
  290. }
  291.  
  292. INTEGERS {multiresult}
  293.  
  294. FUNCTION {multi.page.check}
  295. { 't swap$ :=
  296.   'multiresult #0 :=
  297.     { multiresult not
  298.       t "" = not
  299.       and
  300.     }
  301.     { t #1 #1 substring$ "-" =
  302.       t #1 #1 substring$ "," =
  303.       or
  304.     { 'multiresult #1 := }
  305.     { 't t #2 global.string.max substring$ := }
  306.       if$
  307.     }
  308.   while$
  309.   multiresult
  310. }
  311.  
  312. FUNCTION {format.pages}
  313. { pages missing$
  314.     { "" }
  315.     { pages multi.page.check
  316.     { "pages~" pages n.dashify * }
  317.     { "page~" pages n.dashify * }
  318.       if$
  319.     }
  320.   if$
  321. }
  322.  
  323. FUNCTION {format.vol.num.pages}
  324. { volume field.or.null
  325.   number missing$
  326.     'skip$
  327.     { "(" number * ")" * *
  328.       volume missing$
  329.     { "Warning: there's a number but no volume in " cite$ * top$ }
  330.     'skip$
  331.       if$
  332.     }
  333.   if$
  334.   pages missing$
  335.     'skip$
  336.     { duplicate$ "" =
  337.     'skip$
  338.     { ":" * }
  339.       if$
  340.       pages n.dashify *
  341.     }
  342.   if$
  343. }
  344.  
  345. FUNCTION {format.chapter.pages}
  346. { chapter missing$
  347.     'format.pages
  348.     { "chapter~" chapter *
  349.       pages missing$
  350.     'skip$
  351.     { ", " * format.pages * }
  352.       if$
  353.     }
  354.   if$
  355. }
  356.  
  357. FUNCTION {format.in.ed.booktitle}
  358. { booktitle missing$
  359.     { "" }
  360.     { 's format.editors :=
  361.       s "" =
  362.     { "In " booktitle italicize * }
  363.     { "In " s * ", " * booktitle italicize * }
  364.       if$
  365.     }
  366.   if$
  367. }
  368.  
  369. FUNCTION {format.tr.number}
  370. { type missing$
  371.     { "Technical Report" }
  372.     { type }
  373.   if$
  374.   number missing$
  375.     'skip$
  376.     { "~" * number * }
  377.   if$
  378. }
  379.  
  380. FUNCTION {article}
  381. { output.bibitem
  382.   "author" format.authors output.check
  383.   new.block
  384.   "title" format.title output.check
  385.   new.block
  386.   "journal" journal field.or.null italicize output.check
  387.   format.vol.num.pages output
  388.   "year" format.date output.check
  389.   new.block
  390.   note field.or.null output
  391.   fin.entry
  392. }
  393.  
  394. FUNCTION {book}
  395. { output.bibitem
  396.   author missing$
  397.     { "author and editor" format.editors output.check }
  398.     { "author" format.authors output.check }
  399.   if$
  400.   new.block
  401.   "title" format.btitle output.check
  402.   new.block
  403.   format.bvolume output
  404.   "publisher" publisher field.or.null output.check
  405.   address field.or.null output
  406.   format.edition output
  407.   "year" format.date output.check
  408.   new.block
  409.   note field.or.null output
  410.   fin.entry
  411. }
  412.  
  413. FUNCTION {booklet}
  414. { output.bibitem
  415.   format.authors output
  416.   new.block
  417.   "title" format.btitle output.check
  418.   new.block
  419.   howpublished field.or.null output
  420.   address field.or.null output
  421.   format.date output
  422.   new.block
  423.   note field.or.null output
  424.   fin.entry
  425. }
  426.  
  427. FUNCTION {inbook}
  428. { output.bibitem
  429.   author missing$
  430.     { "author and editor" format.editors output.check }
  431.     { "author" format.authors output.check }
  432.   if$
  433.   new.block
  434.   "title" format.btitle output.check
  435.   "chapter and pages" format.chapter.pages output.check
  436.   new.block
  437.   format.bvolume output
  438.   "publisher" publisher field.or.null output.check
  439.   address field.or.null output
  440.   format.edition output
  441.   "year" format.date output.check
  442.   new.block
  443.   note field.or.null output
  444.   fin.entry
  445. }
  446.  
  447. FUNCTION {incollection}
  448. { output.bibitem
  449.   "authors" format.authors output.check
  450.   new.block
  451.   "title" format.title output.check
  452.   new.block
  453.   "booktitle" format.in.ed.booktitle output.check
  454.   format.chapter.pages output
  455.   "publisher" publisher field.or.null output.check
  456.   address field.or.null output
  457.   "year" format.date output.check
  458.   new.block
  459.   note field.or.null output
  460.   fin.entry
  461. }
  462.  
  463. FUNCTION {inproceedings}
  464. { output.bibitem
  465.   "author" format.authors output.check
  466.   new.block
  467.   "title" format.title output.check
  468.   new.block
  469.   "booktitle" format.in.ed.booktitle output.check
  470.   format.pages output
  471.   organization field.or.null output
  472.   publisher field.or.null output
  473.   address field.or.null output
  474.   "year" format.date output.check
  475.   new.block
  476.   note field.or.null output
  477.   fin.entry
  478. }
  479.  
  480. FUNCTION {conference} { inproceedings }
  481.  
  482. FUNCTION {manual}
  483. { output.bibitem
  484.   format.authors output
  485.   new.block
  486.   "title" format.btitle output.check
  487.   new.block
  488.   organization field.or.null output
  489.   address field.or.null output
  490.   format.edition output
  491.   format.date output
  492.   new.block
  493.   note field.or.null output
  494.   fin.entry
  495. }
  496.  
  497. FUNCTION {mastersthesis}
  498. { output.bibitem
  499.   "author" format.authors output.check
  500.   new.block
  501.   "title" format.btitle output.check
  502.   new.block
  503.   "Master's thesis" output
  504.   "school" school field.or.null output.check
  505.   address field.or.null output
  506.   "year" format.date output.check
  507.   new.block
  508.   note field.or.null output
  509.   fin.entry
  510. }
  511.  
  512. FUNCTION {misc}
  513. { output.bibitem
  514.   format.authors output
  515.   new.block
  516.   format.title output
  517.   new.block
  518.   howpublished field.or.null output
  519.   format.date output
  520.   new.block
  521.   note field.or.null output
  522.   fin.entry
  523. }
  524.  
  525. FUNCTION {phdthesis}
  526. { output.bibitem
  527.   "author" format.authors output.check
  528.   new.block
  529.   "title" format.btitle output.check
  530.   new.block
  531.   "PhD thesis" output
  532.   "school" school field.or.null output.check
  533.   address field.or.null output
  534.   "year" format.date output.check
  535.   new.block
  536.   note field.or.null output
  537.   fin.entry
  538. }
  539.  
  540. FUNCTION {proceedings}
  541. { output.bibitem
  542.   editor missing$
  543.     { organization missing$
  544.     'skip$
  545.     { organization field.or.null output }
  546.       if$
  547.     }
  548.     { format.editors output }
  549.   if$
  550.   new.block
  551.   "title" format.btitle output.check
  552.   editor missing$
  553.     'skip$
  554.     { organization field.or.null output }
  555.   if$
  556.   publisher field.or.null output
  557.   address field.or.null output
  558.   "year" format.date output.check
  559.   new.block
  560.   note field.or.null output
  561.   fin.entry
  562. }
  563.  
  564. FUNCTION {techreport}
  565. { output.bibitem
  566.   "author" format.authors output.check
  567.   new.block
  568.   "title" format.btitle output.check
  569.   new.block
  570.   format.tr.number output
  571.   "institution" institution field.or.null output.check
  572.   address field.or.null output
  573.   "year" format.date output.check
  574.   new.block
  575.   note field.or.null output
  576.   fin.entry
  577. }
  578.  
  579. FUNCTION {unpublished}
  580. { output.bibitem
  581.   "author" format.authors output.check
  582.   new.block
  583.   "title" format.title output.check
  584.   new.block
  585.   format.date output
  586.   new.block
  587.   "note" note field.or.null output.check
  588.   fin.entry
  589. }
  590.  
  591. FUNCTION {default.type} { book }
  592.  
  593. MACRO {jan} {"January"}
  594.  
  595. MACRO {feb} {"February"}
  596.  
  597. MACRO {mar} {"March"}
  598.  
  599. MACRO {apr} {"April"}
  600.  
  601. MACRO {may} {"May"}
  602.  
  603. MACRO {jun} {"June"}
  604.  
  605. MACRO {jul} {"July"}
  606.  
  607. MACRO {aug} {"August"}
  608.  
  609. MACRO {sep} {"September"}
  610.  
  611. MACRO {oct} {"October"}
  612.  
  613. MACRO {nov} {"November"}
  614.  
  615. MACRO {dec} {"December"}
  616.  
  617. MACRO {acmcs} {"ACM Computing Surveys"}
  618.  
  619. MACRO {acta} {"Acta Informatica"}
  620.  
  621. MACRO {cacm} {"Communications of the ACM"}
  622.  
  623. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  624.  
  625. MACRO {ibmsj} {"IBM Systems Journal"}
  626.  
  627. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  628.  
  629. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  630.  
  631. MACRO {ieeetcad}
  632.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  633.  
  634. MACRO {ipl} {"Information Processing Letters"}
  635.  
  636. MACRO {jacm} {"Journal of the ACM"}
  637.  
  638. MACRO {jcss} {"Journal of Computer and System Sciences"}
  639.  
  640. MACRO {scp} {"Science of Computer Programming"}
  641.  
  642. MACRO {sicomp} {"SIAM Journal on Computing"}
  643.  
  644. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  645.  
  646. MACRO {tods} {"ACM Transactions on Database Systems"}
  647.  
  648. MACRO {tog} {"ACM Transactions on Graphics"}
  649.  
  650. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  651.  
  652. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  653.  
  654. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  655.  
  656. MACRO {tcs} {"Theoretical Computer Science"}
  657.  
  658. READ
  659.  
  660. STRINGS {longest.label}
  661.  
  662. INTEGERS { number.label longest.label.width }
  663.  
  664. FUNCTION {initialize.longest.label}
  665. { 'longest.label "" :=
  666.   'number.label #1  :=
  667.   'longest.label.width #0 :=
  668. }
  669.  
  670. FUNCTION {longest.label.pass}
  671. { 'label number.label int.to.str$ :=
  672.   'number.label number.label #1 + :=
  673.   label width$ longest.label.width >
  674.     { 'longest.label label :=
  675.       'longest.label.width label width$ :=
  676.     }
  677.     'skip$
  678.   if$
  679. }
  680.  
  681. EXECUTE {initialize.longest.label}
  682.  
  683. ITERATE {longest.label.pass}
  684.  
  685. FUNCTION {preamble}
  686. { "\begin{thebibliography}{"  longest.label  * "}" * write$
  687.   newline$
  688. }
  689.  
  690. EXECUTE {preamble}
  691.  
  692. EXECUTE {init.state.consts}
  693.  
  694. ITERATE {call.type$}
  695.  
  696. FUNCTION {finish.up} { newline$ "\end{thebibliography}" write$ newline$ }
  697.  
  698. EXECUTE {finish.up}
  699.